// 自定义全局指令
import type { App } from "vue";
export default function globalDirectives(app: App) {
  // 获取文件名
  const model: any = import.meta.glob("./*.ts", { eager: true }); // 遍历文件
  let obj = {};
  for (const key in model) {
    const name = key.split("/")[1].split(".")[0];
    const component = model[key].default;
    obj[name] = component;
    app.directive(name, component);
  }
  console.log(obj, "自定义指令");
}
